package com.xoomworks.rsfr.core.service;

import java.util.List;

import com.xoomworks.rsfr.model.Resource;

/**
 * Resource service interface.
 *
 * @author bogdan.sbiera
 */
public interface ResourceService extends BaseService<Resource> {

    /**
     * Returns all resources created by a certain User.
     *
     * @return a a List of Resources or an empty List if there are no Resources
     *         published by the user with the given id
     */
    public List<Resource> getByUserId();

    /**
     * Returns all resources created by a certain User.
     *
     * @param id
     *            the id of the User
     * @return a List of Resources or an empty List if there are no Resources
     *         published by the user with the given id
     */
    public List<Resource> getPublicResourcesByCompanyId(Long id);

    /**
     * Returns all resources by a company.
     *
     * @return a List of Resources or an empty List if there are no Resources.
     *         published by the user with the given id
     */
    public List<Resource> getAllResourcesFromOwnCompany();

    /**
     * Searches for resources.
     * @param searchString self explanatory
     * @param page the page number
     * @return list of resources ordered by relevance (most relevant first)
     */
    public List<Resource> freeTextSearch(String searchString, int page);
}
